package com.example.photoview;

import javafx.scene.control.Alert;

import java.util.ArrayList;
/**
 * 完成图片剪切操作
 */

public class CutAction {
    private HomeController homeController=(HomeController) ControllerUtil.controllers.get(HomeController.class.getSimpleName());
        ArrayList<ImageModel> sourceList = SelectionModel.getImageModels();//存放图片本身的List
        public CutAction(ImageBox imageBox){
        if (sourceList.isEmpty()) {
            SelectedModel.setSourcePath((imageBox.getImageModel()).getImageFilePath());
            SelectedModel.setWaitingPasteNum(1);
        } else {
            SelectedModel.setSourcePath(sourceList);
            SelectedModel.setWaitingPasteNum(sourceList.size());
        }
        SelectedModel.setCopyOrMove(1);
        System.out.println(SelectedModel.getCopyOrMove());
       homeController.pasteButton.setDisable(false);
        Alert alert = new Alert(Alert.AlertType.INFORMATION);
        alert.titleProperty().set("提示信息");
        alert.headerTextProperty().set("已剪切到剪贴板");
        alert.showAndWait();

    }

}
